package tech.aistar.corejava.day09;

/**
 * Created by 豆梦寒 on 2019/7/25.
 */
public class EqualsStudentDemo {
    public static void main(String[] args) {
        Student s1= new Student(1,"1110");
        Student s2= new Student(1,"1110");

        System.out.println(s1==s2);//false
        //没有重写equals之前为false
        System.out.println(s1.equals(s2));//true

        System.out.println(s1.equals(null));//false
        //自己和自己比较为true
        System.out.println(s1.equals(s1));//true

        System.out.println(s1.equals("abc"));//false

        System.out.println("========================");

        System.out.println(s1.equals(s2));//true
    }
}
